";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="{$d["UID"]}";
$d["XML"].="{$d["PWD"]}";
$d["XML"].="{$d["SID"]}";
$d["XML"].="{$d["PID"]}";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="5";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="STARTTIME";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="";
$d["XML"].="";
$URL = "http://{$XML_SITE}/WBXService/XMLService";
$Result = postIt($d,$URL,$XML_PORT);
// Output calling user variables
echo "Calling user variables";
echo "SID={$d["SID"]}
";
echo "UID={$d["UID"]}
";
echo "PID={$d["PID"]}
";
echo "XML_SITE={$XML_SITE}
";
exit;
//
// postIt()
//
// POSTs the XML action document and calling user variables
// to the specified WebEx XML Server and receives an XML response document
//
function postIt($DataStream, $URL, $Port)
{
// Strip http:// from the URL if present
$URL = ereg_replace("^http://", "", $URL);
// Separate into Host and URI
$Host = substr($URL, 0, strpos($URL, "/"));
$URI = strstr($URL, "/");
// Form the request body
$reqBody = "";
while (list($key, $val) = each($DataStream)) {
if ($reqBody) $reqBody.= "&";
$reqBody.= $key."=".urlencode($val);
}
$ContentLength = strlen($reqBody);
$xml = $DataStream['XML'];
// Generate the request header
global $Debug_Mode;
$Debug_Mode = 1;
$URL = $Host;
$fp = fsockopen($URL,80,$errno,$errstr);
$Post = "POST /WBXService/XMLService HTTP/1.0\n";
$Post .= "Host: $URL\n";
$Post .= "Content-Type: application/x-www-form-urlencoded\n";
$Post .= "Content-Length: ".strlen($xml)."\n\n";
$Post .= "$xml\n";
if($Debug_Mode){
echo "
XML Sent:
";
}
if($fp){
fwrite($fp,$Post);
$response = "";
while (!feof($fp)) {
$response .= fgets($fp, 1024);
}
if($Debug_Mode){
echo "
XML Received:
";
}
return $response;
}
else{
echo "$errstr ($errno)
\n";
return false;
}
}
?>